import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from "./router";
import { createPinia } from 'pinia'
import {useUserStore} from "./stores/user.ts";

const pinia = createPinia()
const app = createApp(App)

app.use(ElementPlus)

app.use(router)
app.use(pinia)
const userStore = useUserStore()
const user = localStorage.getItem('user')
if (user) {
    userStore.login(JSON.parse(user))
}
app.mount('#app')